<template>
  <div class="discover">
    <div class="liveList" v-for='(item, index) in goodsList' :key='index'>
      <div class="liveItem" v-for='(subItem, subindex) in item.modelData.ctList' :key='subindex'>
        <div class="Item_img">
          <img :src="subItem.showCover" alt="">
          <span>{{subItem.desc}}</span>
        </div>
        <div class="live_per clear-float">
          <div class="per_icon fl">
            <img :src="subItem.userInfo.avatar" alt="">
          </div>
          <div class="fl">
            <div class="per_name">{{subItem.userInfo.name}}</div>
            <div>
              <span>{{subItem.userInfo.height}}cm</span>
              <span>{{subItem.userInfo.weight}}kg</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
// import { getGoodsDetails } from '@/api/home.js'
export default {
  created () {
    this.init()
  },
  data () {
    return {
      goodsList: []
    }
  },
  methods: {
    init () {
      this.$api.getGoodsDetails().then(res => {
        if (res.data.code === 200) {
          this.goodsList = res.data.list
        }
      })
    }
  }
}
</script>
<style lang='less' scoped>
  .discover{
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 9px;
    .liveList {
      display: flex;
      box-sizing: border-box;
      margin-bottom: 8px;
      .liveItem {
        width: 33.33%;
        margin-right: 6px;
        background-color: #fff;
        .Item_img{
          img{
            width: 100%;
            height: 100%;
          }
          span {
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow: hidden;
            margin: 5px 0px 10px 5px;
          }
        }
        .live_per{
          width: 100%;
          height: 36px;
          padding: 0px 6px 10px 6px;
          .per_icon {
            width: 24px;
            height: 24px;
            margin-right: 4px;
            margin-top: 3px;
            img{
              border-radius: 50%;
              width: 100%;
              height: 100%;
            }
          }
          .per_name {
            font-weight: 700;
            color: #333;
            max-width: 70px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
          }
        }
      }
      .liveItem:last-child{
        margin-right: 0px !important;
      }
    }
  }
</style>
